﻿<Window x:Class="ZuggerWpf.NewArriveNotify"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Background="{x:Null}"
    WindowStyle="None"
    AllowsTransparency="True"
    ResizeMode="NoResize"
    ShowInTaskbar="False"
    Topmost="True"
    Title="Zugger" 
    Height="120" 
    Width="180"
    Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <LinearGradientBrush x:Key="bg" StartPoint="0, 0" EndPoint="0, 1">
                <GradientStop Color="Gray" Offset="0"/>
                <GradientStop Color="WhiteSmoke" Offset="1"/>
            </LinearGradientBrush>
            <Storyboard x:Key="HighlightCloseButton">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="btnClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.4"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="FadeCloseButton">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="btnClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.4"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </ResourceDictionary>
    </Window.Resources>

    <Window.Triggers>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="btnClose">
            <BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}" Name="HighlightCloseButton_BeginStoryboard"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="btnClose">
            <BeginStoryboard Storyboard="{StaticResource FadeCloseButton}" Name="FadeCloseButton_BeginStoryboard"/>
        </EventTrigger>
    </Window.Triggers>
    <Border CornerRadius="8">
        <Border.Background>
            <StaticResourceExtension ResourceKey="bg" />
        </Border.Background>
        <Grid Margin="5">
            <Line X1="10" Y1="30" X2="160" Y2="30" Stroke="#FF4B4B4B" StrokeThickness="2">
                <Line.Effect>
                    <DropShadowEffect/>
                </Line.Effect>
            </Line>
            <StackPanel  Margin="0, 10, 0, 0" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Label>
                    <Hyperlink Click="Hyperlink_Click">
                        <TextBlock Name="txtTip" FontSize="15" FontFamily="微软雅黑" Text="TextHere" TextWrapping="Wrap"/>
                    </Hyperlink>
                </Label>
            </StackPanel>
            <Label VerticalAlignment="Top" FontFamily="Bradley Hand ITC" FontSize="16" Foreground="WhiteSmoke" Content="Zugger">
                <Label.Effect>
                    <DropShadowEffect/>
                </Label.Effect>
            </Label>
            <Image Name="btnClose"  HorizontalAlignment="Right" Margin="0,5,5,0" VerticalAlignment="Top" Width="16" Height="16" Stretch="Fill" Opacity="0.4" MouseUp="Close_Up" Source="/Zugger;component/Resources/closepic.png" />
        </Grid>
    </Border>
</Window>
